package com.lywz.biz.common.entity.example;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.lywz.core.entity.AbstractEntity;
import com.lywz.core.entity.EntityAnnotation;

	
/*@Table(name = "t_user")
@NamedNativeQueries(@NamedNativeQuery(name = "user.queryUser", query = "from User", resultSetMapping = "user"))
@SqlResultSetMappings(@SqlResultSetMapping(name = "user", entities = { @EntityResult(entityClass = com.lywz.biz.common.entity.user.User.class) }))
@Entity
@EntityAnnotation*/
@Entity
@Table(name = "t_user")
/*@NamedNativeQueries({
	@NamedNativeQuery(name="user.queryUser", query="select * from t_user u where u.name= :name",resultSetMapping = "user")
})
@SqlResultSetMappings(@SqlResultSetMapping(name = "user", entities = { @EntityResult(entityClass = com.lywz.biz.common.entity.User.class) }))
*/
@NamedQueries({
	@NamedQuery(name="user.queryUser", query="from User u where u.name= :name")
})
@EntityAnnotation
public class User extends AbstractEntity{
	private static final long serialVersionUID = 8245976145159578037L;
	@Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
	private int id;
	private String name;
	private String password;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	
}
